<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="description" content="" />
    <meta name="author" content="" />
    <title>Password Reset</title>
    <style>
  		.error_msg{color: red}
	</style>
    <!-- Bootstrap Core CSS -->
    <link href="../../../css/bootstrap.min.css" rel="stylesheet" th:href="@{/css/bootstrap.min.css}" />
    <!-- Custom CSS -->
    <link href="../../../css/grayscale.css" rel="stylesheet" th:href="@{/css/grayscale.css}" />
    
    <link rel="stylesheet" href="../../../script/easyui/themes/icon.css" th:href="@{/script/easyui/themes/icon.css}" />
    <link rel="stylesheet" href="../../../script/easyui/themes/black/easyui.css" th:href="@{/script/easyui/themes/black/easyui.css}" />
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body id="page-top" data-spy="scroll" data-target=".navbar-fixed-top">

    <!-- Navigation -->
    <nav class="navbar navbar-custom navbar-fixed-top" role="navigation">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-main-collapse">
                    <i class="fa fa-bars"></i>
                </button>
                <a class="navbar-brand page-scroll" href="../index.html" th:href="@{/}">
                    <i class="fa fa-play-circle"></i>  <span class="light">Film</span> Renting
                </a>
            </div>

            <div class="collapse navbar-collapse navbar-right navbar-main-collapse"></div>
            <!-- /.navbar-collapse -->
        </div>
        <!-- /.container -->
    </nav>

    <!-- Intro Header -->
    <header class="intro">
        <div class="intro-body">
            <div class="container">
                <div class="row">
                    <div class="col-md-8 col-md-offset-0">
                        <form action="#" method="post" th:action="@{/resetPassword}">
						   <h4><input type="text" name="username" placeholder="Username" /><span class="error_msg"></span></h4>
						   <h4><input type="submit" value="Submit" class="btn btn-primary" /></h4>    
						</form>
					<div id="success"></div>
                    </div>
                </div>
            </div>
        </div>
    </header>

    <!-- Map Section -->
    <div id="map"></div>

    <!-- jQuery -->
    <script src="../../../script/jquery-2.1.4.min.js" th:src="@{/script/jquery-2.1.4.min.js}"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="../../../script/bootstrap.min.js" th:src="@{/script/bootstrap.min.js}"></script>

    <!-- Plugin JavaScript -->
    <script src="../../../script/jquery.easing.min.js" th:src="@{/script/jquery.easing.min.js}"></script>

    <!-- Custom Theme JavaScript -->
    <script src="../../../script/grayscale.js" th:src="@{/script/grayscale.js}"></script>
    
    <script>
      $(function(){
		$('form').submit(function(){
		  $.post($('form').attr('action'), $('form').serialize(), function(result){
			if(!result){
			  $('.error_msg').text('Username not found.');
			}else{
			  $('form').hide();
			    $('#success').html('Password has been reset.<br /> A email has sent to the mail box:  ' + result + '  <br />please check your email to confirm the new password.');
			  }
		  });
		  return false;
		});
      });
    </script>
</body>
</html>
